import { useCounter } from './useCounter'


const meta = {
  title: 'Hook/useCounter',
  component: useCounter,
  tags: ['autodocs'],
  render: () => ({
    components: {  },
    setup() {
      const { count, doubled, increment } = useCounter(5)
      return { count, doubled, increment }
    },
    template: `    
      <div>
        <p>Count: {{ count }}</p>
        <p>Doubled: {{ doubled }}</p>
        <button @click="increment">+1</button>
      </div>
    `
  })


} satisfies Meta<typeof useCounter>;

export default meta;
type Story = StoryObj<typeof meta>;

export const Basic: Story = {
  name: '基础用法',
  args: {
    ...meta.args,
  },
};